/*******************************************************************/
/* @ All Rights Reserved Copyright (C) 2014 broada,Co.,Ltd.        */
/*                                                                 */
/*  NAME      = ora_stmt.h                                         */
/*  NOTE      =                                                    */
/*  DATE      = 2014/12/11 by songbb                               */
/*******************************************************************/

#ifndef __ORA_STMT_H_
#define __ORA_STMT_H_

void ora_free_req_stmt(Conntrack *p_st_conn);

int ora_create_new_stmt(Conntrack *p_st_conn
                        , Sql_statement **pp_st_stmt);

int ora_set_new_stmt(Conntrack *p_st_conn
                    , Sql_statement **pp_st_stmt);

Sql_statement* ora_get_stmt(Conntrack *p_st_conn
                            , long l_cursor_id);

Sql_statement* ora_get_new_stmt(Conntrack *p_st_conn);

Sql_statement* ora_get_current_stmt(Conntrack *p_st_conn);

int ora_push_ttc7_new_stmt(Conntrack *p_st_conn
                        , Sql_statement **pp_st_stmt);

Sql_statement* ora_pop_ttc7_new_stmt(Conntrack *p_st_conn);

void ora_clear_ttc7_new_stmt(Conntrack *p_st_conn);

void ora_free_private_stmt(L7session_ora_private *p_st_session_private);

int ora_stmt_add_define_metadata(Sql_statement *p_st_stmt
                                , Ora_metadata st_ora_metadata);

int ora_stmt_add_bind_metadata(Sql_statement *p_st_stmt
                            , Ora_metadata st_ora_metadata);

int ora_stmt_add_column_metadata(Sql_statement *p_st_stmt
                                , Ora_metadata st_ora_metadata);

Frlist_node *ora_create_closed_cursor_node(unsigned long ul_cursor);

int ora_add_closed_cursor(L7session_ora *p_st_sess
                        , unsigned long ul_cursor);

int ora_set_resultset_resp(L7_ora_packet *p_st_ora_packet
                        , Sql_statement *p_st_stmt);

void ora_report_closed_stmt(Conntrack *p_st_conn
                            , L7session_ora *p_st_sess
                            , L7_ora_packet *p_st_ora_packet
                            , Frhash_header *p_st_hash_report);

void ora_report_all_stmt(Conntrack *p_st_conn
                        , L7session_ora *p_st_sess
                        , Frhash_header *p_st_hash_report);

#endif
